const Mock = require('mockjs')
const count=100;
const BoutiqueEntryList=[];

for(let i=0;i<count;i++){
    BoutiqueEntryList.push(Mock.mock({
      id: '@increment',
      number:'@integer(209011234,579011234)',
      name:'@first',
      entrycost:'@integer(200114,571234)',
      paytype:'@integer(0,5)',
      entrytype:'@integer(0,2)',
      entrystate:'@integer(0,2)',
      paystate:'@integer(0,5)',
      supplier:'@first',
      createtime:'@datetime',
    }))
  
  }

  module.exports=[
    //boutiqueentry
    {
        url: '/api/boutique/boutiqueentry',
        type: 'get',
        response: config => {
          const { importance, type, title, page = 1, limit = 20, sort } = config.query
    
          let mockList = BoutiqueEntryList.filter(item => {
            return true
          })
    
          if (sort === '-id') {
            mockList = mockList.reverse()
          }
    
          const pageList = mockList.filter((item, index) => index < limit * page && index >= limit * (page - 1))
    
          return {
            code: '10000',
            data: {
              total: mockList.length,
              items: pageList
            }
          }
        }
    },
]